#include "QtMaintimer.h"



QtMainTimer::QtMainTimer(int interval, QObject * parent) : QTimer(parent)
{
	m_interval = interval;

	m_timerRoutine = new CTimerRoutine();
}


QtMainTimer::~QtMainTimer()
{
	if (m_timerRoutine)
		delete m_timerRoutine;
}

bool QtMainTimer::TimerFire(TimerFire_namespace::TimerFireType type)
{


	if (type == TimerFire_namespace::statisfiretimer)
	{
		return m_timerRoutine->TimerFire(TimerFire_namespace::statisfiretimer); 
	}
	else if (type == TimerFire_namespace::appreinitfiretimer)
	{
		return m_timerRoutine->TimerFire(TimerFire_namespace::appreinitfiretimer); 
	}



	return false;

}

void QtMainTimer::Start()
{
	start(m_interval);
}